#ifndef GEOMETRIC_VERTEX
#define GEOMETRIC_VERTEX


namespace mif
{

	class Face;
	
	struct Coord3D
	{
		double x;
		double y;
		double z;
	};
	
	class Vertex
	{

		public:
			
			Vertex();
			
			Vertex(double, double, double);
			
			~Vertex();
			
			
			const int GetID() const;
			
			const Coord3D GetCoord() const;
			
			Face * GetFace() const;
			
			
			void SetFace(Face &);
			
			
			Vertex * begin();
			
			Vertex * end();
		
		public:
		
			static int mVertexCount;
			
		private:
		
			int mID;
			Coord3D mCoord;
			Face * mFace;
			
					
		public:
				
			class FacesIterator
			{
			
				public:
				
					FacesIterator(Vertex * pVertex) : 
						mVertex(pVertex),
						mPtr(pVertex->mFace),
						mFirstView(true)
					{
						//EMPTY
					}
					
					~FacesIterator()
					{
						//EMPTY
					}
					
					Face operator *();
					
					Face* operator ->();
					
					bool operator != (const FacesIterator&);
					
					bool operator == (const FacesIterator&);
					
					FacesIterator& operator ++();

				private:
				
					Vertex* mVertex;
					Face * mPtr;
					bool mFirstView;

			};

			class VerticesIterator
			{
				public:

					VerticesIterator(Vertex * v) : 
						mFaceIt(v), 
						mVertex(v)
					{
						//EMPTY
					}

					Vertex operator *();
					
					Vertex* operator ->();
					
					bool operator != (const VerticesIterator&);
					
					bool operator == (const VerticesIterator&);
					
					VerticesIterator& operator ++();

				private:
				
					FacesIterator mFaceIt;
					Vertex* mVertex;
					bool mFirstView;
					
			};


	};
}

#endif
